package ntue.dtd;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

public class Map_page extends Activity {
	private ImageView imageview;
	private Button button1 , button2 , enlargeButton;
	private int enlargeCount = 0;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.page1);
		mainViews();

	}

	private void mainViews() {
		imageview = (ImageView) findViewById(R.id.imageView02);
		button1 = (Button)findViewById(R.id.button2);
		button2 = (Button)findViewById(R.id.button3);
		enlargeButton = (Button)findViewById(R.id.enlargeButton);
	}

	/**
	 * 點擊放大地圖後
	 * 
	 * @param v
	 */
	public void enlarge(View v) {
		enlargeCount += 1;
		switch (enlargeCount) {
		   case 1:
			   imageview.setImageDrawable(getResources().getDrawable(R.drawable.checks));
			   break;
		   case 2:
			   imageview.setImageDrawable(getResources().getDrawable(R.drawable.checkscale1));
			   break;
		   case 3:
			   imageview.setImageDrawable(getResources().getDrawable(R.drawable.checkscale2));
			   break;
		default:

		}
	}

	/**
	 * 確定按鈕
	 * 
	 * @param v
	 */
	public void okClick(View v) {
		if(enlargeCount >= 3){
			Intent intent = new Intent();
			intent.setClass(Map_page.this, Reserve_page.class);
			startActivity(intent);
			Map_page.this.finish();
		}
	}

	/**
	 * 取消按鈕
	 * 
	 * @param v
	 */
	public void cancelClick(View v) {

	}

}
